package cn.edu.zzuli.nothinglink.mapper;

import cn.edu.zzuli.nothinglink.entity.Work;
import cn.edu.zzuli.nothinglink.mapper.provider.WorkProvider;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Result;
import org.apache.ibatis.annotations.Results;
import org.apache.ibatis.annotations.SelectProvider;

import java.util.List;

/**
 * <p>
 *  Mapper 接口
 * </p>
 *
 * @author suzyyy
 * @since 2021-04-22
 */
public interface WorkMapper extends BaseMapper<Work> {

    @SelectProvider(type = WorkProvider.class, method = "getCourseWorks")
    @Results(
            id = "getCourseWorksInList",
            value = {
                    @Result(column = "is_end", property = "end")
            }
    )
    List<Work> getCourseWorksInList(List<Integer> courseIds);

}
